package myaddressbook;

import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
/**
 * 查询结果界面
 * @author Little-Grey
 *
 */
public class ShowResult{
	public JLabel Lname,Lbirthday,Lphone,Lemail,Lother,Lnote,Lsex;
	public JLabel Lname2=new JLabel(),Lbirthday2=new JLabel(),Lphone2=new JLabel(),
			Lemail2=new JLabel(),Lother2=new JLabel(),Lnote2=new JLabel(),Lsex2=new JLabel();
	public JButton certain;
	public JFrame frame=new JFrame("查询结果如下");
	public ShowResult() {
		// TODO Auto-generated constructor stub
		Container c = frame.getContentPane();
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setSize(400,300);
		frame.setLayout(new GridLayout(5,1));
		frame.setVisible(true);
		Lname = new JLabel("姓名：");
		Lsex = new JLabel("性别：");
		Lbirthday = new JLabel("生日：");
		Lphone = new JLabel("电话：");
		Lemail = new JLabel("Email：");
		Lother = new JLabel("住址：");
		certain = new JButton("确认");
		JPanel pane1 = new JPanel();
		JPanel pane2 = new JPanel();
		JPanel pane3 = new JPanel();
		JPanel pane4 = new JPanel();
		JPanel pane5 = new JPanel();
		JPanel pane6 = new JPanel();
		JPanel pane7 = new JPanel();
		JPanel pane8 = new JPanel();
		c.add(pane1);
		c.add(pane6);
		c.add(pane2);
		c.add(pane7);
		c.add(pane3);
		c.add(pane8);
		c.add(pane4);
		c.add(pane5);
		pane1.add(Lname);
		pane1.add(Lname2);
		pane6.add(Lsex);
		pane6.add(Lsex2);
		pane2.add(Lbirthday);
		pane2.add(Lbirthday2);
		pane7.add(Lphone);
		pane7.add(Lphone2);
		pane3.add(Lemail);
		pane3.add(Lemail2);
		pane8.add(Lother);
		pane8.add(Lother2);
	    pane5.add(certain);
	    certain.addActionListener(new ActionListener()                           
	    		{
	    	public void actionPerformed(ActionEvent e)
	    	{
	    		frame.dispose();	
	    		}
	    	}
	    );
	    }
}
